<template>
	<!-- 管理员登录 -->
	<view class="authLogin" :style="'height:'+windowHeight+'rpx;'">
		<view class="auth-main">
			<view class="logoImg">
				<image src="https://huishou.68699.cn/attachment/images/2/uploads/20240229/bedfdfcc15c319d73cea46b233de786f.png" mode="aspectFit"></image>
			</view>
			<view class="title">欢迎使用管理系统</view>
			<view class="login">
				<view class="login-box">
					<view class="loginBox-title">管理员账号</view>
					<input type="text" v-model="autoUserName" placeholder-style="color:#C9CACA;" placeholder="请输入您的管理员账号" />
				</view>
				<view class="login-box">
					<view class="loginBox-title">管理员密码</view>
					<input type="password" v-model="autoPassword" placeholder-style="color:#C9CACA;" placeholder="请输入您的管理员密码" />
				</view>
			</view>
		</view>
		<view class="orderLogin" @tap="orderLogin">立即登录</view>
	</view>
</template>

<script>
	import $http from "@/component/commen/api/request.js";//引入封装的请求
	export default {
		data() {
			return {
				windowHeight:"",//当前屏幕高度
				autoUserName:"",//管理员用户名
				autoPassword:"",//管理员密码
				
			};
		},
		mounted() {
			let sysInfo = uni.getSystemInfoSync()
			let scaleFactor = 750 / sysInfo.windowWidth
			this.windowHeight = sysInfo.windowHeight * scaleFactor
		},
		methods:{
			orderLogin(){
				if(this.autoUserName==""){
					return uni.showToast({
						title:"请输入管理员账号",
						icon:"none"
					})
				}else if(this.autoPassword==""){
					return uni.showToast({
						title:"请输入管理员密码",
						icon:"none"
					})
				}
				$http({
					url:"?i=2&t=0&v=2.7.4&from=wxapp&c=entry&a=wxapp&do=admin&op=login&m=wjyk_recycle&sign=16b5f0a0edaa124634ff022b45a987bf",
					method:"get",
					data:{
						account:this.autoUserName,
						password:this.autoPassword
					}
				}).then((res)=>{
					console.log(res)
					if(res.data.errno!=0){
						return uni.showToast({
							title:res.data.message,
							icon:"none"
						})
					}
					uni.setStorageSync("isauthLogin",true)
					uni.navigateTo({//跳转到平台统计
						url:"/otherPages/census/statistics/statistics"
					})
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
.authLogin{
	width: 100%;
	background: url("https://huishou.68699.cn/attachment/images/2/uploads/20240318/230e9e533062bc9976289e01775bc7e5.jpg");
	background-size: 130%;
	.auth-main{
		padding:40rpx 80rpx;
		box-sizing: border-box;
		.logoImg{
			width: 120rpx;
			height: 120rpx;
			image{
				width: 100%;
				height: 100%;
				border-radius: 50%;
			}
		}
		.title{
			font-size: 40rpx;
			color: #00b388;
			margin-top: 40rpx;
			font-weight: bold;
		}
	}
	.login{
		margin-top: 180rpx;
		.login-box{
			padding: 40rpx 0;
			border-bottom: 2rpx solid #f0f0f0;
			.loginBox-title{
				font-size: 34rpx;
				font-weight: bold;
			}
			input{
				margin-top: 40rpx;
			}
		}
	}
	.orderLogin{
		background: #00b388;
		color: #fff;
		font-size: 38rpx;
		font-weight: bold;
		text-align: center;
		margin: 0 auto;
		margin-top: 40rpx;
		width: 600rpx;
		padding: 25rpx 0;
		border-radius: 80rpx;
	}
}
</style>
